var router = require('koa-router')();


//获取省份
router.post('/getProvinces',async (ctx,next) => {
    let result = await ctx.get('/region/list-province',{});
    console.log('/getProvinces===================',result);
    ctx.body = result;
});

//获取所有城市
router.post('/getCities',async (ctx,next) => {
	let {
		code,
	} = ctx.request.body;
    let result = await ctx.get('/region/list-city',{code});
    console.log('/getCities===================',result);
    ctx.body = result;
});

//获取所有地区
router.post('/getRegions',async (ctx,next) => {
	let {
		code,
	} = ctx.request.body;
    let result = await ctx.get('/region/list-area',{code});
    console.log('/getRegions===================',result);
    ctx.body = result;
});

export default router;
